<%@ page language="java" pageEncoding="UTF-8" %>
<!doctype html>
<html lang="zh-CN">
<head>
    <%@include file="/WEB-INF/views/commons/common.jsp" %>
    <link rel="stylesheet" type="text/css"
          href="${base_href}/static/ui-frame/bootstrap/3.3.5/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css"
          href="${base_href}/static/ui-frame/bootstrap-dialog3/css/bootstrap-dialog.css">

    <link rel="stylesheet" type="text/css"
          href="${base_href}/static/css/main.css">
    <title>武汉银成</title>
</head>
<body>
<div class="main-wrap">
    <div class="container-fluid header-div">
        <div class="row header">

            <div style="width: 90%; margin: 0 auto; min-width: 980px;">
                <div class="col-lg-4 col-xs-4 col-sm-4 logo-div">
                    <img src="${base_href}/static/image/logo.png" style="height:100px;width:100px"/>
                </div>
                <div class="col-lg-6 col-lg-offset-2 col-xs-offset-2 col-xs-6 col-sm-6 login-info-back">
                    <img src="${base_href}/static/image/logo.png" style="height:100px;width:100px"/>
                    <div class="login-info">
                        欢迎&nbsp; ${user.userName} &nbsp; <span id="showtime"></span>
                        <a href="logout.jsp">注销</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="body-div">
        <div class="menu panel-group" id="menu">
            <c:forEach items="${menu}" var="m">
                <div class="panel">
                    <div class="panel-body">
                        <h4>
                            <a href="javascript:void(0)" title="${m.menuName }"
                               onclick="changeMyIframeSrc('${base_href}/${m.menuPath}')">${m.menuName }</a>
                        </h4>
                    </div>
                </div>
            </c:forEach>

        </div>
        <div class="content-div">
            <div class="rig-con" id="iframeDiv">
                <iframe id="myIframe" name="myIframe" src="" class="autoHeight"
                        style="border:0px;overfiow:none;min-Height: 600px;">
                </iframe>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>

</div>

<script type="text/javascript" src="${base_href}/static/ui-frame/jquery/1.11.3/jquery.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/iframe-auto-height/jquery.autoheight.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/bootstrap/3.3.5/js/bootstrap.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/bootstrap-dialog3/js/bootstrap-dialog.js"></script>

<script>

    $(function () {
        initTime();
        var a = $('#menu').find('a').first().click();
    })

    function initTime() {
        var show_day = new Array('星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六');
        var time = new Date();
        var year = time.getFullYear();
        var month = time.getMonth();
        var date = time.getDate();
        var day = time.getDay();
        month = month + 1;
        var now_time = year + '年' + month + '月' + date + '日' + ' ' + show_day[day];
        document.getElementById('showtime').innerHTML = now_time;
    }

    function changeMyIframeSrc(url) {
        BootstrapDialog.blockUI({
            iconOnly: true
        });
        document.getElementById('iframeDiv').removeChild(
            document.getElementById('myIframe'));
        if (!+[1,]) {
            CollectGarbage();
        }
        document.getElementById('iframeDiv').innerHTML = '<iframe  id="myIframe" name="myIframe"  src="' + url + '" class="autoHeight" scrolling="no" frameborder="0" style="min-Height:600px;"></iframe>';

        var myIframe = document.getElementById('myIframe');
        if (myIframe.attachEvent) {
            myIframe.attachEvent("onload", function () {
                BootstrapDialog.unblockUI();
            });
        } else {
            myIframe.onload = function () {
                BootstrapDialog.unblockUI();
            }
        }
    }

</script>
</body>
</html>
